package main

import (
	"net/rpc"
	"log"
	"fmt"
)


type Args struct  {
	A,B int
}

type Quotient struct {
	Quo,Dim int
}

type Arith int


func main() {

	client,err := rpc.DialHTTP("tcp","192.168.20.95:1234")
	if err != nil {
		println("conn rpc error ",err.Error())
	}
	args := Args{81,8}
	var repay int
	err = client.Call("Arith.Multply",args,&repay)
	if err != nil {
		log.Fatal("失败 ",err.Error())
	}
	fmt.Printf("Arith %d * %d = %d",args.A,args.B,repay)

	qtent := new(Quotient)
	doneCall := client.Go("Arith.Divide",args,&qtent,nil)
	 <- doneCall.Done

	fmt.Printf(" div %d %d", qtent.Dim,qtent.Quo)
}


